package cn.kazuz.service.login.service.impl;

import cn.kazuz.service.login.entity.AdminLogin;
import cn.kazuz.service.login.mapper.AdminLoginMapper;
import cn.kazuz.service.login.service.AdminLoginService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * @author KAZU
 * @description 针对表【ADMIN_LOGIN(管理员登录表)】的数据库操作Service实现
 * @createDate 2023-09-24 22:32:33
 */
@SuppressWarnings({"all"})
@Service
public class AdminLoginServiceImpl extends ServiceImpl<AdminLoginMapper, AdminLogin>
		implements AdminLoginService {
	
	@Autowired
	private AdminLoginMapper adminLoginMapper;
	
	@Override
	public AdminLogin login(@NonNull String adminUsername,@NonNull String adminPassword) {
		if ("admin".equals(adminUsername) && "123".equals(adminPassword)) {
			//TODO:特殊路由权限
			System.out.println("欢迎超级管理员大大驾到！！大家统统让道！！！！！");
		}
		QueryWrapper<AdminLogin> wrapper = new QueryWrapper<>();
		wrapper.eq("ADMIN_USERNAME", adminUsername);
		wrapper.eq("ADMIN_PASSWORD", adminPassword);
		AdminLogin adminLogin = adminLoginMapper.selectOne(wrapper);
		return adminLogin;
	}
}




